package com.asg.guesswhat;

import java.util.HashMap;
//import java.util.*;
/*import java.util.Properties;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;*/

//import net.asg.guesswho.errors.RowColMaxExceedException;

/**
 * @author blakbro2k This is a master utility class that holds the classes for
 *         all small objects that the application uses. This allows a single
 *         point of edit for all utility classes
 */
public class Utils {
	/** Catalog of all application messages */
	protected MessageCatalog messageCatalog = new MessageCatalog();
	//protected SaxXMLParser parser = new SaxXMLParser();
	//protected CardSet cardSet;
	//protected GameBoard gameBoard;
	//protected Config cfg;
	//final protected int STANDARD_WIDTH = 6;
	//final protected int STANDARD_HEIGHT = 4;

	// private String configFilePath;

	// protected Card card = new Card();

	/**
	 * A constructor
	 */
	public Utils() {
	}

	/**
	 * A overloaded constructor
	 * 
	 * @param configFilePath
	 * 
	 *            loads a configurations file from the class loader
	 */
	public Utils(String configFilePath) {
		//cfg = new Config(configFilePath);
	}



	/**
	 * @author blakbro2k Catalog of all application messages
	 * 
	 */
	protected class MessageCatalog {
		HashMap<String, String> messageCatalog = new HashMap<String, String>();

		/**
		 * constructor
		 */
		public MessageCatalog() {
			this.messageCatalog.put("welcome", "Welcome to 'Who IS that'");
			this.messageCatalog.put("notifyWin", "You Win, Perfect");
			this.messageCatalog.put("notifyLose", "You Lose");
			this.messageCatalog.put("errorRowColMaxExceed",
					"Row multiplied by Column cannot exceed max Card Set size");
			this.messageCatalog.put("errorGeneric", "This is a Generic error");
		}

		/**
		 * This method gets that mapped message string of the input value
		 * 
		 * @param m
		 *            input string of mapped message
		 * @return Mapped Message
		 */
		public String getMessage(String m) {
			return messageCatalog.get(m);
		}
	}
}
